Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RP1 PIO support #6470

Merged
merged 11 commits into from
Nov 15, 2024
Merged

RP1 PIO support #6470

merged 11 commits into from
Nov 15, 2024

Conversation

pelwell
Copy link
Contributor

@pelwell pelwell commented Nov 15, 2024

This patch set provides support for accessing the PIO hardware in RP1. Aside from the data FIFOs, the registers are inaccessible over PCIe, so all interactions must be proxied via the RP1 firmware.

The included pwm-pio driver and overlay provides up to 4 PWM channels on arbitrary header pins, and acts as an example of in-kernel usage.

Requires the latest Pi 5 EEPROM image. User-space support and some more examples can be found in the utils repo: raspberrypi/utils#102

(Incorporates #6464.)

Attempting to start a non-idle channel causes an error message to be
logged, and is inefficient. Test for emptiness of the desc_issued list
before doing so.

Signed-off-by: Phil Elwell <[email protected]>
@pelwell pelwell changed the title Piorp1 RP1 PIO support Nov 15, 2024
@pelwell pelwell force-pushed the piorp1 branch 4 times, most recently from 83e590f to 8b43487 Compare November 15, 2024 13:21
The Raspberry Pi RP1 includes 2 M3 cores running firmware. This driver
adds a mailbox communication channel to them via a doorbell and some
shared memory.

Signed-off-by: Phil Elwell <[email protected]>
The RP1 firmware runs a simple communications channel over some shared
memory and a mailbox. This driver provides access to that channel.

Signed-off-by: Phil Elwell <[email protected]>
Provide remote access to the PIO hardware in RP1. There is a single
instance, with 4 state machines.

Signed-off-by: Phil Elwell <[email protected]>
Declare the communications channel to RP1.

Signed-off-by: Phil Elwell <[email protected]>
Declare the device that proxies RP1's PIO hardware.

Signed-off-by: Phil Elwell <[email protected]>
The header file linux/pio_rp1.h adds a pico-sdk-like interface to the
RP1 PIO subsystem for other drivers.

Signed-off-by: Phil Elwell <[email protected]>
Use the PIO hardware on RP1 to implement a PWM interface.

Signed-off-by: Phil Elwell <[email protected]>
Enable building of the pwm-pio-rp1 driver, which is Pi 5-specific.

Signed-off-by: Phil Elwell <[email protected]>
Add an overlay to enable a single-channel PIO-assisted PWM interface on any
header pin.

Signed-off-by: Phil Elwell <[email protected]>
@pelwell pelwell merged commit ba7e2e3 into raspberrypi:rpi-6.6.y Nov 15, 2024
11 of 12 checks passed
@pelwell
Copy link
Contributor Author

pelwell commented Nov 15, 2024

Note: I think there's a problem running on the 32-bit OS - probably the missing CONFIG_COMPAT support.

@igorpecovnik
Copy link

and when compiling:

https://paste.armbian.de/yufeboteja
error: include/uapi/misc/rp1_pio_if.h: missing "WITH Linux-syscall-note" for SPDX-License-Identifier

@pelwell
Copy link
Contributor Author

pelwell commented Nov 16, 2024

That doesn't look like a regular build error - are you installing headers?

@igorpecovnik
Copy link

are you installing headers?

Armbian build automation throws those errors out after this commit. I haven't look closer, but yes, it looks like headers are being installed in the process, line 20030 of paste. And I think they have to work.

@pelwell
Copy link
Contributor Author

pelwell commented Nov 16, 2024

Does the patch in #6472 solve the problem?

@pelwell
Copy link
Contributor Author

pelwell commented Nov 18, 2024

32-bit OS support now resolved by #6476.

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Nov 18, 2024
kernel: fixup! misc: Add RP1 PIO driver
kernel: misc: rp1-pio: Add compat_ioctl method
See: raspberrypi/linux#6470

kernel: configs: enable driver for Vertexcom MSE102X
See: raspberrypi/linux#6474

kernel: Add GPS avoidance option to IMX477
See: raspberrypi/linux#6468

kernel: can: mcp251xfd: mcp251xfd_ring_alloc(): fix coalescing configuration
See: raspberrypi/linux#6466
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Nov 18, 2024
kernel: fixup! misc: Add RP1 PIO driver
kernel: misc: rp1-pio: Add compat_ioctl method
See: raspberrypi/linux#6470

kernel: configs: enable driver for Vertexcom MSE102X
See: raspberrypi/linux#6474

kernel: Add GPS avoidance option to IMX477
See: raspberrypi/linux#6468

kernel: can: mcp251xfd: mcp251xfd_ring_alloc(): fix coalescing configuration
See: raspberrypi/linux#6466
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Nov 20, 2024
See: raspberrypi/linux#6463

kernel: dtoverlays: enable SPI CS active-high
See: raspberrypi/linux#6477

kernel: drivers: media: pci: Update Hailo accelerator device driver to v4.19
See: raspberrypi/linux#6478

kernel: misc: rp1-pio: Add FIFO-related methods
See: raspberrypi/linux#6470
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Nov 20, 2024
See: raspberrypi/linux#6463

kernel: dtoverlays: enable SPI CS active-high
See: raspberrypi/linux#6477

kernel: drivers: media: pci: Update Hailo accelerator device driver to v4.19
See: raspberrypi/linux#6478

kernel: misc: rp1-pio: Add FIFO-related methods
See: raspberrypi/linux#6470
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants